home *** CD-ROM | disk | FTP | other *** search
- ;Diags.Was v1.00 Displays diagnostic files.
-
- ;****************************************************************************
- ;* *
- ;* DIAGS.WAS *
- ;* Copyright (C) 1992 Datastorm Technologies, Inc. *
- ;* All rights reserved *
- ;* *
- ;* Purpose: Displays diagnostic files for help in debugging problems. *
- ;* *
- ;* This ASPECT SCRIPT file adds an item to the Procomm Plus for Windows *
- ;* menubar which says "View System" and is selectable from ALT-V. When this*
- ;* new item is selected, a drop down box with five choices is displayed. *
- ;* Four files can be viewed: AUTOEXEC.BAT, CONFIG.SYS, WIN.INI, and *
- ;* SYSTEM.INI. The fifth choice is Quit to quit the program and erase the *
- ;* option from your menubar. *
- ;* *
- ;* This ASPECT SCRIPT is intended only as a sample of ASPECT programming. *
- ;* DATASTORM makes no warranty of any kind, express or implied, including *
- ;* without limitation, any warranties of mechantability and/or fitness *
- ;* for a particular purpose. Use of this program is at your own risk. *
- ;* *
- ;* IMPORTANT!! The global variables below need to be changed to match your *
- ;* locations for these files if they are different than listed. *
- ;* *
- ;* Author: Chris Brandow *
- ;* *
- ;****************************************************************************
-
- ;****************************************************************************
- ;* *
- ;* GLOBAL VARIABLES *
- ;* *
- ;* Don't forget to change these to match your system!! *
- ;* *
- ;****************************************************************************
-
- string AutoFile = "C:\AUTOEXEC.BAT" ;change these to match
- string ConfigFile = "C:\CONFIG.SYS" ;your system.
- string SysFile = "C:\WINDOWS\SYSTEM.INI"
- string WinFile = "C:\WINDOWS\WIN.INI"
- string PWFile = "C:\WINDOWS\PW.INI"
- ;****************************************************************************
- ;* *
- ;* MAIN *
- ;* The procedure Main calls the procedure Diags which does the menubar *
- ;* addition and tests to see which menu item was selected. Based on the *
- ;* value of the item selected, the procedure for the appropriate selection *
- ;* is called. *
- ;* *
- ;* Calls: Diags *
- ;* Modifies globals: none *
- ;* *
- ;****************************************************************************
-
- proc Main
-
- set aspect spawn on ; Allow other scripts to run
- Diags()
-
- endproc
-
- ;****************************************************************************
- ;* *
- ;* DIAGS *
- ;* The procedure Diags puts the menubar option on the existing PW menubar *
- ;* and does nothing until the user wants to see one of the files available *
- ;* through this option. When the user selects View System, menuitems drop *
- ;* down for the user to select. When the user selects anything but the *
- ;* Quit option, the respective file will be displayed in an editbox for the *
- ;* user to view it or change it. *
- ;* *
- ;* Calls: AutoDisplay, ConfigDisplay, SysDisplay, WinDisplay *
- ;* Called by: Main *
- ;* Modifies globals: none *
- ;* *
- ;****************************************************************************
-
- proc Diags
- integer MenuID, DiagValue
-
- menupopup $PWMENUBAR "&View System" MenuID ;starts the menubar add-ons.
- menuitem MenuID 6 "&AUTOEXEC.BAT" ;puts in menuitems below
- menuitem MenuID 7 "&CONFIG.SYS" ;the view system option.
- menuitem MenuID 8 "&SYSTEM.INI"
- menuitem MenuID 9 "&WIN.INI"
- menuitem MenuID 10 "&PW.INI"
- menuitem MenuID 11 "&QUIT"
- showmenu $PWMENUBAR ;don't forget to showmenu!
-
- DiagValue = $MENU
-
- while DiagValue != 11 ;while Quit is not selected.
- DiagValue = $MENU
-
- switch DiagValue ;switch to the item that was
- case 6 ;chosen which will go to the
- AutoDisplay() ;respective procedure.
- endcase
-
- case 7
- ConfigDisplay()
- endcase
-
- case 8
- SysDisplay()
- endcase
-
- case 9
- WinDisplay()
- endcase
-
- case 10
- PWDisplay()
- endcase
- endswitch
- endwhile
- endproc
-
- ;****************************************************************************
- ;* *
- ;* AUTODISPLAY *
- ;* The procedure AutoDisplay is called when the user wants to view their *
- ;* AUTOEXEC.BAT file from the drop down menu items. This procedure simply *
- ;* displays the file that the user specifies in the global variable above. *
- ;* The global variables should be changed if the user's files are in a *
- ;* different location than specified. *
- ;* Before the file is displayed, the attributes of the file are read and *
- ;* stored. The attributes are then set to nothing and the file is allowed *
- ;* to be changed. When the user is finished with the file, the attributes *
- ;* are restored to the original settings. *
- ;* There are two buttons at the bottom of the dialog box. One is an OK *
- ;* button which will save the file and exit the dialog box but not the *
- ;* script. The other is a Cancel pushbutton which will just exit the dialog*
- ;* box without saving the file. !!!!If cancel is hit, all changes will be *
- ;* lost!!!! *
- ;* *
- ;* Calls: nothing *
- ;* Called by: Diags *
- ;* Modifies globals: none *
- ;* *
- ;****************************************************************************
-
- proc AutoDisplay
- string AutoAttr, NoAttr = ""
- integer BoxValue
-
- getfattr AutoFile AutoAttr ;get attributes of file.
- setfattr AutoFile NoAttr ;set attributes to null.
- dialogbox 65 65 297 193 7 "AUTOEXEC.BAT" ;display dialogbox.
- feditbox 0 0 294 169 AutoFile
- pushbutton 55 173 61 14 "&OK" normal
- pushbutton 179 173 61 14 "&Cancel" cancel
- enddialog
-
- BoxValue = $DIALOG
-
- while BoxValue != 1 ;loop until cancel is hit.
- BoxValue = $DIALOG ;read value of button hit.
- if BoxValue == 10 ;if OK was hit,
- statmsg "Updating AUTOEXEC.BAT..." ;display message on status,
- destroydlg ;remove dialogbox,
- pause 1 ;pause so user can read it,
- statclear ;clear status line,
- exitwhile ;and exit the while loop.
- endif
- endwhile
- setfattr AutoFile AutoAttr ;put the attributes back.
- endproc
-
- ;****************************************************************************
- ;* *
- ;* CONFIGDISPLAY *
- ;* The procedure ConfigDisplay is called when the user wants to view their *
- ;* CONFIG.SYS file from the drop down menu items. This procedure simply *
- ;* displays the file that the user specifies in the global variable above. *
- ;* The global variables should be changed if the user's files are in a *
- ;* different location than specified. *
- ;* *
- ;* Calls: nothing *
- ;* Called by: Diags *
- ;* Modifies globals: none *
- ;* *
- ;****************************************************************************
-
- proc ConfigDisplay
- string ConfigAttr, NoAttr = ""
- integer BoxValue
-
- getfattr ConfigFile ConfigAttr ;get attributes of file.
- setfattr ConfigFile NoAttr ;set attributes to null.
- dialogbox 65 65 297 193 7 "CONFIG.SYS" ;display dialogbox.
- feditbox 0 0 294 169 ConfigFile
- pushbutton 55 173 61 14 "&OK" normal
- pushbutton 179 173 61 14 "&Cancel" cancel
- enddialog
-
- BoxValue = $DIALOG
-
- while BoxValue != 1 ;loop until cancel is hit.
- BoxValue = $DIALOG ;read value of button hit.
- if BoxValue == 10 ;if OK was hit,
- statmsg "Updating CONFIG.SYS..." ;display message on status,
- destroydlg ;remove dialogbox,
- pause 1 ;pause so user can read it,
- statclear ;clear status line,
- exitwhile ;and exit the while loop.
- endif
- endwhile
- setfattr ConfigFile ConfigAttr ;put the attributes back.
- endproc
-
- ;****************************************************************************
- ;* *
- ;* SYSDISPLAY *
- ;* The procedure SysDisplay is called when the user wants to view their *
- ;* SYSTEM.INI file from the drop down menu items. This procedure simply *
- ;* displays the file that the user specifies in the global variable above. *
- ;* The global variables should be changed if the user's files are in a *
- ;* different location than specified. *
- ;* *
- ;* Calls: nothing *
- ;* Called by: Diags *
- ;* Modifies globals: none *
- ;* *
- ;****************************************************************************
-
- proc SysDisplay
- string SysAttr, NoAttr = ""
- integer BoxValue
- getfattr SysFile SysAttr ;get attributes of file.
- setfattr SysFile NoAttr ;set attributes to null.
- dialogbox 65 65 297 193 7 "SYSTEM.INI" ;display dialogbox.
- feditbox 0 0 294 169 SysFile
- pushbutton 55 173 61 14 "&OK" normal
- pushbutton 179 173 61 14 "&Cancel" cancel
- enddialog
-
- BoxValue = $DIALOG
-
- while BoxValue != 1 ;loop until cancel is hit.
- BoxValue = $DIALOG ;read value of button hit.
- if BoxValue == 10 ;if OK was hit,
- statmsg "Updating SYSTEM.INI..." ;display message on status,
- destroydlg ;remove dialogbox,
- pause 1 ;pause so user can read it,
- statclear ;clear status line,
- exitwhile ;and exit the while loop.
- endif
- endwhile
- setfattr SysFile SysAttr ;put the attributes back.
- endproc
-
- ;****************************************************************************
- ;* *
- ;* WINDISPLAY *
- ;* The procedure WinDisplay is called when the user wants to view their *
- ;* WIN.INI file from the drop down menu items. This procedure simply *
- ;* displays the file that the user specifies in the global variable above. *
- ;* The global variables should be changed if the user's files are in a *
- ;* different location than specified. *
- ;* *
- ;* Calls: nothing *
- ;* Called by: Diags *
- ;* Modifies globals: none *
- ;* *
- ;****************************************************************************
-
- proc WinDisplay
- string WinAttr, NoAttr = ""
- integer BoxValue
-
- getfattr WinFile WinAttr ;get attributes of file.
- setfattr WinFile NoAttr ;set attributes to null.
- dialogbox 65 65 297 193 7 "WIN.INI" ;display dialogbox.
- feditbox 0 0 294 169 WinFile
- pushbutton 55 173 61 14 "&OK" normal
- pushbutton 179 173 61 14 "&Cancel" cancel
- enddialog
-
- BoxValue = $DIALOG
-
- while BoxValue != 1 ;loop until cancel is hit.
- BoxValue = $DIALOG ;read value of button hit.
- if BoxValue == 10 ;if OK was hit,
- statmsg "Updating WIN.INI..." ;display message on status,
- destroydlg ;remove dialogbox,
- pause 1 ;pause so user can read it,
- statclear ;clear status line,
- exitwhile ;and exit the while loop.
- endif
- endwhile
- setfattr WinFile WinAttr ;put the attributes back.
- endproc
-
- ;****************************************************************************
- ;* *
- ;* PWDISPLAY *
- ;* The procedure PWDisplay is called when the user wants to view their *
- ;* PW.INI file from the drop down menu items. This procedure simply *
- ;* displays the file that the user specifies in the global variable above. *
- ;* The global variables should be changed if the user's files are in a *
- ;* different location than specified. *
- ;* *
- ;* Calls: nothing *
- ;* Called by: Diags *
- ;* Modifies globals: none *
- ;* *
- ;****************************************************************************
-
- proc PWDisplay
- string PWAttr, NoAttr = ""
- integer BoxValue
-
- getfattr PWFile PWAttr ;get attributes of file.
- setfattr PWFile NoAttr ;set attributes to null.
- dialogbox 65 65 297 193 7 "PW.INI" ;display dialogbox.
- feditbox 0 0 294 169 PWFile
- pushbutton 55 173 61 14 "&OK" normal
- pushbutton 179 173 61 14 "&Cancel" cancel
- enddialog
-
- BoxValue = $DIALOG
-
- while BoxValue != 1 ;loop until cancel is hit.
- BoxValue = $DIALOG ;read value of button hit.
- if BoxValue == 10 ;if OK was hit,
- statmsg "Updating PW.INI..." ;display message on status,
- destroydlg ;remove dialogbox,
- pause 1 ;pause so user can read it,
- statclear ;clear status line,
- exitwhile ;and exit the while loop.
- endif
- endwhile
- setfattr PWFile PWAttr ;put the attributes back.
- endproc
-
-